<?php
require_once(APPLICATION_PATH . DIRECTORY_SEPARATOR . 'modules'
        											. DIRECTORY_SEPARATOR . 'cms'
        											. DIRECTORY_SEPARATOR . 'admin'
													. DIRECTORY_SEPARATOR . 'models'
													. DIRECTORY_SEPARATOR . 'Article.php');
													
class Zend_View_Helper_ArticleViewModule {

    public $view;
	
    public function setView($view) {
        $this->view = $view;
    }

    public function articleViewModule($position, $articleid) {        
        $this->view->addScriptPath(APPLICATION_PATH . DIRECTORY_SEPARATOR . 'modules'
        											. DIRECTORY_SEPARATOR . 'cms'
        											. DIRECTORY_SEPARATOR . 'admin'
        											. DIRECTORY_SEPARATOR . 'views'
        											. DIRECTORY_SEPARATOR . 'scripts'
        											. DIRECTORY_SEPARATOR . 'rightmodules');
        											
        $model = new Article();
        $this->view->article = $model->getArticleById($articleid);
        $this->view->placeholder($position)->captureStart();
        echo $this->view->render('article_view.phtml');
        $this->view->placeholder($position)->captureEnd();
    }

}